Skip to content

fix(engine): map.terrain help names the walls' object form (#2605) - #2630

Merged
giswqs merged 2 commits into
opengeos:mainfrom
elpidioassinaturas:fix/2605-terrain-help-walls
Nov 22, 2026
Merged

giswqs merged 2 commits into
opengeos:mainfrom
elpidioassinaturas:fix/2605-terrain-help-walls

Conversation

@elpidioassinaturas

@elpidioassinaturas elpidioassinaturas commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2605.

What

map.terrain's parameter text (shown by search_commands, the MCP server and the command palette) gave the block's "walls" as a colour only. The parser has also taken {"color"?, "layer"?} since #2173. The help now reads:

"walls"?: "#RRGGBB" (default #C8B89A) | {"color"?: "#RRGGBB" (default #C8B89A), "layer"?: a polygon layer that holds all its features (not one read a view at a time; it may be hidden): its symbology colours the walls where its polygons meet the block's edge, and the walls are color off its polygons}

Two errors also left out keys the parser accepts. They now list them the way the unknown-key errors do:

  • "block": <not an object> now lists (extent, depth, walls, shape, radius, water) (it left out shape and radius).
  • "water": <not an object> now lists (layer, level, glint, shore) (it left out glint and shore).

"shape": {"layer", "where"} (#2486) was already in the help. The user guide (docs/user-guide/maps.md) already describes both forms, so no docs change.

Test

terrain_help_names_every_block_key sends an unknown key to each part (block, walls, shape, the block's water, the terrain's water). It reads the keys the parser lists in its refusal and checks that the matching part of the help names each one, quoted. It also checks that the "isn't an object" errors list the same keys. A key added to a refusal's list but not to the help now fails the test. The list sits on the line next to the matches! arm it mirrors, so the test does not check those two against each other.

Checks

  • cargo test -p rustgis-engine --lib -- terrain_help terrain_block params_name_every_key: 12 passed
  • cargo clippy -p rustgis-engine --all-targets -- -D warnings: clean
  • cargo fmt --all -- --check: clean

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated terrain command help to describe walls with an optional polygon layer, box, circle, and polygon-defined block shapes, circle radius, and block-water options.
  • Bug Fixes
    • Terrain validation errors now list the available keys for blocks and water, including shape and radius for blocks, and layer, level, glint, and shore for water.

…2605)

The help gave "walls" as a colour only, though the parser has also
taken {"color", "layer"} since opengeos#2173. The errors for a block or a
water value that isn't an object also left out keys (shape and radius;
glint and shore).

A test checks each part of the help (block, walls, shape, the block's
water, the terrain's water) against the keys the parser lists when it
refuses an unknown one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The map.terrain help now describes walls objects, block shapes, and block water. Block and water validation messages list additional accepted keys. A test compares those keys with the help text and checks non-object errors against unknown-key errors.

Changes: Terrain help and validation

Layer / File(s) Summary
Document and check terrain options
crates/engine/src/cmd/view.rs, crates/engine/src/tests.rs
The help describes walls objects with color and polygon-layer options, block shapes and radius, and block water. Block and water validation messages list their accepted keys. A test compares the keys in the help and validation messages.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other · Severity of issue fixed: Low

Possibly related PRs

Suggested reviewers: giswqs

Merge Risk: Minimal · up to c04cf

This updates terrain help text and validation messages to name the accepted block, walls, and water keys, and adds a test that keeps them in sync with the parser. Parsing behavior is unchanged, so merge risk is minimal.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the repository template's main parts. It has a Summary (the What section explains the help text change and the two error-message fixes), a Testing section (new test `terrain_he… Complete the UI evidence section. The help text shown in the command palette, search_commands, and the MCP server is user-visible. Attach before and after screenshots of the map.terrain parameter help as shown in the command palette, or exp…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title "fix(engine): map.terrain help names the walls' object form (#2605)" matches the main change. The PR updates the map.terrain parameter help so block.walls documents its {"color", "layer"} ob…
Linked Issues check Passed Issue #2605 requires two coding changes. (1) The map.terrain help must document the walls object form {"color"?, "layer"?} and how a polygon layer colours the walls. (2) A test must check that the hel…
Out of Scope Changes check Passed The changes are the map.terrain help text (walls object form, confirmed at head), two "is not an object" error messages that now list parser-accepted keys (block: shape and radius; water: glint and sh…
Full details: Title check

Explanation

The title "fix(engine): map.terrain help names the walls' object form (#2605)" matches the main change. The PR updates the map.terrain parameter help so block.walls documents its {"color", "layer"} object form. The title also names the scope (engine) and the issue number. It does not cover the two not-an-object error key additions, which is acceptable for a title.

Full details: Linked Issues check

Explanation

Issue #2605 requires two coding changes. (1) The map.terrain help must document the walls object form {"color"?, "layer"?} and how a polygon layer colours the walls. (2) A test must check that the help names every key terrain_block accepts (extent, depth, walls, shape, radius, water). Requirement (1) is met at head c04cfef. The params text in crates/engine/src/cmd/view.rs now reads "walls"?: "#RRGGBB" (default #C8B89A) | {"color"?: ..., "layer"?: a polygon layer that holds all its features (it may be hidden): its symbology colours the walls where its polygons meet the block's edge, and the walls are color off its polygons}. Requirement (2) is supported by the PR summary of crates/engine/src/tests.rs, which reports terrain_help_names_every_block_key, and by the reported test run (12 passed). I could not read the tests.rs diff or the parser error lines at head. The diff tool returned no text, so the test content is supported by summary evidence only. The head also changed since the previous review (2c1c774 to c04cfef). I could not isolate the incremental change, so I did not carry the earlier conclusion forward as verified for the test.

Full details: Out of Scope Changes check

Explanation

The changes are the map.terrain help text (walls object form, confirmed at head), two "is not an object" error messages that now list parser-accepted keys (block: shape and radius; water: glint and shore), and a test that compares help text and error keys with the parser. The error-message and test changes concern the same keys that issue #2605 asks to be covered, so they are connected to the objective and not unrelated. No docs or unrelated code changes appear in the summary. The PR states the user guide already covers both forms. The error-message and test hunks were not readable at head, so this verdict relies on the PR summary for those hunks.

Full details: Description check

Explanation

The description follows the repository template's main parts. It has a Summary (the What section explains the help text change and the two error-message fixes), a Testing section (new test terrain_help_names_every_block_key plus reported cargo test, clippy, and fmt results), and a Related issue reference (Fixes #2605). The UI evidence section is missing its required statement. The PR changes parameter help text shown by search_commands, the MCP server, and the command palette, which a reviewer can see. The template says to keep the 'No visible UI change.' line only when no UI changes exist. The author did not state a before/after screenshot or justify skipping the section, so this required item is incomplete.

Resolution

Complete the UI evidence section. The help text shown in the command palette, search_commands, and the MCP server is user-visible. Attach before and after screenshots of the map.terrain parameter help as shown in the command palette, or explain why the help text is not a visible UI change and keep the 'No visible UI change.' line. Also consider adding a short note in the Summary that the change is documentation text only, with no change to accepted input.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit reads the terrain guide,
Walls gain a layer by their side.
Box and circle, polygon too,
Water keys are listed true.
The tests check each name in view,
Then hop along the path anew.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fa2fd96d-9c0a-49fc-990f-c95ca8d2ed8d
Commits

Reviewing files that changed from the base of the PR and between 2c1c774 and c04cfef.

Files selected for processing: 1

  • crates/engine/src/cmd/view.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@elpidioassinaturas
elpidioassinaturas marked this pull request as ready for review November 22, 2026 02:39
Comment thread crates/engine/src/tests.rs Resolved
Comment thread crates/engine/src/cmd/view.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I checked the diff against the parser in crates/engine/src/cmd/view.rs (terrain_block, terrain_water, the walls and shape helpers) and against docs/user-guide/maps.md. The help text matches what the parser accepts, and the two "isn't an object" messages list the same keys as the unknown-key errors. I found no bugs, crash paths, silent data loss, or security issues.

Bugs: none found. I traced each of the five refusal cases in the new test through the parser and confirmed the help parts it searches for contain the expected quoted keys.

Security: none found. The change only edits help text and error strings.

Performance: none found.

Quality (both can wait for the release quality pass):

  • The test takes each part's key set only from the refusal text, which is a separate hand-written list beside the matches! arm. A key added to the match but not to the message would pass the test, so the doc comment and the PR's claim that a missing help key "now fails the test" overstate the coverage. Sharing one const would close the gap. Confidence: medium. (Inline comment on crates/engine/src/tests.rs:14392.)
  • The walls help phrase "color off them" is cryptic. The user guide's wording, "Off every polygon the walls are color", reads more clearly. The help also doesn't say that the walls' layer must hold all its features, which the parser enforces. Confidence: high for the wording, low for the omission. (Inline comment on crates/engine/src/cmd/view.rs:52.)

AGENTS.md:

  • The "Reach every surface" rule asks the PR to say which surfaces it reaches and why the others don't apply. The PR body mentions the command palette, search_commands and MCP, but it doesn't address the browser, CLI, Python, phone or plugins. This is a text-only change, so the gap is small. Confidence: medium.

Already raised: none. There were no prior review threads, so I left no earlier concerns alone.

Change size

Compared with the base branch: the whole PR against main (merge base d7d717e to PR head 2c1c774).

Measure Value
Files changed 2 (0 added, 2 modified, 0 removed, 0 renamed)
Size before 3.30 MB
Size after 3.30 MB
Total size change +2.3 KB
Path Before After Change
crates/engine/src/tests.rs 3.25 MB 3.25 MB +2.1 KB
crates/engine/src/cmd/view.rs 48.2 KB 48.3 KB +179 B

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📖 Docs preview

Commit c04cfef from a fork built, but isn't published until a maintainer adds the preview label (once per commit).

@giswqs giswqs added the preview Publish a fork pull request's docs preview (maintainers, once per commit) label Nov 22, 2026
Review round 1 on opengeos#2630: say that the walls are `color` off the
layer's polygons, and that the layer must hold all its features
(the parser refuses one read a view at a time).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elpidioassinaturas

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the 2-file diff against the parser in crates/engine/src/cmd/view.rs and the prior threads. I could not run cargo test in this environment, so the checks below are by reading only.

I checked that each key list in the new help matches the parser:

  • block unknown key and not-an-object messages (view.rs:311, :527) list extent, depth, walls, shape, radius, water, the same set the matches! arm accepts.
  • water messages (view.rs:476, :528) list layer, level, glint, shore, matching the arm at :475.
  • The walls object (color, layer) and the shape object (layer, where) match view.rs:338 and :399.
  • The test is inside #[cfg(test)] mod tests (lib.rs:46-47), so the unwrap/panic! calls are allowed.
  • The part() ranges in the test each resolve to the intended help section. Each from string occurs once in the help text, and each to string is the first match after it.

Bugs

None found. The error texts and the help text agree with the parser, and the test exercises both the unknown-key and the not-an-object paths for each part. Confidence: high.

Security

None found. Changes are help text and error strings only. Confidence: high.

Performance

None found. Confidence: high.

Quality

Nothing new beyond the two earlier threads (see below). Confidence: high.

AGENTS.md

  • The PR description does not say which surfaces the help change reaches, as "Reach every surface" asks. The params string feeds search_commands, the MCP server and the command palette, so the reach is probably complete. The PR should still say so. Confidence: medium (about 60%); this is a PR-description gap, not a code defect.

Earlier concerns: I left 2 alone, both already raised by the reviewer and answered. The test-coverage point (the test reads key sets from the refusal text, so the matches! arm and its message can drift apart) was acknowledged and deferred to the release quality pass. The walls wording and "holds all its features" point was applied in c04cfef.

Change size

Compared with the base branch: the whole PR against main (merge base d7d717e to PR head c04cfef).

Measure Value
Files changed 2 (added 0, modified 2, removed 0, renamed 0)
Size before 3.30 MB (3,460,351 B)
Size after 3.30 MB (3,462,808 B)
Total size change +2.4 KB (+2,457 B)
Path Before After Change
crates/engine/src/tests.rs 3.25 MB (3,411,021 B) 3.25 MB (3,413,215 B) +2.1 KB (+2,194 B)
crates/engine/src/cmd/view.rs 48.2 KB (49,330 B) 48.4 KB (49,593 B) +263 B

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@giswqs
giswqs enabled auto-merge November 22, 2026 03:16
@giswqs
giswqs added this pull request to the merge queue Nov 22, 2026
Merged via the queue into opengeos:main with commit 533e875 Nov 22, 2026
27 checks passed
@github-actions github-actions Bot removed the preview Publish a fork pull request's docs preview (maintainers, once per commit) label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: map.terrain help omits the walls object form ({"color", "layer"}) added in #2173

3 participants